home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1987 September & October / rerun-1987-09-10a.d64 / phaser phire (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  192 lines

  1. 0 rem starship * 1987 * robert b. cook *
  2. 100 print"[147][158]       p h a s e r   p h i r e
  3. 102 [153]"reading data....
  4. 104 poke53280,0:poke53281,0:poke650,128:ifpeek(14336)=60then114
  5. 106 poke52,56:poke56,56:clr:rem poke53296,3
  6. 108 poke56334,peek(56334)and254:poke1,peek(1)and251
  7. 110 fori=0to2047:pokei+14336,peek(i+53248):next
  8. 112 poke1,peek(1)or4:poke56334,peek(56334)or1:rem poke53296,252
  9. 114 poke53272,(peek(53272)and240)+14
  10. 116 dim gc(2,9,9),xc(2),yc(2),xd(5),yd(5),sp(2),pr(3)
  11. 118 dim xh(5),yh(5),sh(2,5),th(2),pl(2),pl$(2),ss$(2,5)
  12. 120 pl=2:sp(1)=48:sp(2)=200:r=rnd(-ti):vc=53248:sp=53269
  13. 122 lf=54272:hf=54273:wv=54276:at=54277:sr=54278:pokelf+24,15
  14. 124 gosub424:poke2040,13
  15. 126 cl$="                                    [145]
  16. 128 d$[178]"
  17. 130 pl$(1)="starfleet ":pl$(2)="klingon "
  18. 132 print"[145][155]number of players? [1-2]  ";
  19. 134 geta$:np=val(a$):ifnp<1ornp>2then134
  20. 136 pl$="and":ifnp=1thenpl$="or
  21. 138 [153]a$:[153]"listuse joystick port two "pl$"  * on\cmd=on ^  keys
  22. 140 print"press fire or return to place spaceship and fire phasers
  23. 142 [153]"syspress any key to start":[151]198,0:[146]198,1
  24. 144 [143] start
  25. 146 [153]"loadlist (NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)
  26. 148 print" [164][164][164][164][164][164][164][146][158] p h a s e r  p h i r e [155][164][164][164][164][164][164][164]
  27. 150 [153]" usrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusr
  28. 152 print"[154][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187][150][180][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  29. 154 print"[154][161]s t a r f l e e t[161][150][180][146] k l i n g o n s [161]"
  30. 156 print"[154][188][146][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][199][150][200][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][190]"
  31. 158 print"[154] [146]                                    [150] "
  32. 160 print"[154]  [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]  [150][180] [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]  "
  33. 162 fori=0to9:print"[154] [170][146][193][194][195][193][194][195][193][194][195][193][194][195][193][194][195][181] [150][180][170][146][193][194][195][193][194][195][193][194][195][193][194][195][193][194][195][150][181] ":next
  34. 164 print"[154]  [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]  [150][180] [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]  "
  35. 166 print"[154]  starship  -----  [150][180] cruiser   -----  "
  36. 168 print"[154]  destroyer ----   [150][180] bomber    ----   "
  37. 170 print"[154]  fighter   ---    [150][180] fighter   ---    "
  38. 172 print"[154]  satellite --     [150][180] satellite --     "
  39. 174 print"[154][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][150][204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]
  40. 176 [143] spacecraft placement
  41. 178 pl[178]3[171]pl:m[178]1:k[178]5:[151]646,18[171]pl[172]4
  42. 180 [129]i[178]1[164]4
  43. 182 [153]cl$"position "[170]pl$(pl)[170]ss$(pl,k)
  44. 184 [139]pl[178]1[176]np[178]2[167][141]320:[137]188
  45. 186 x[178][181]([187](1)[172]10):y[178][181]([187](1)[172]10):[145][181]([187](1)[172]2[170]1)[141]362,370
  46. 188 k[178]k[171]1:[130]:[151]sp,0
  47. 190 [153]cl$"
  48. 192 fori=0to9:print"[154] [170][146][193][194][195][193][194][195][193][194][195][193][194][195][193][194][195][181] [150][180][170][146][193][194][195][193][194][195][193][194][195][193][194][195][193][194][195][181] ":next
  49. 194 ifpl=1then178
  50. 196 pl=1:xc(1)=0:yc(1)=0:xc(2)=0:yc(2)=0:sp(2)=200:pokevc+16,0
  51. 198 rem player attack
  52. 200 pl=3-pl:m=2
  53. 202 printcl$"[154]scan and fire phasers
  54. 204 [141]320:[141]280:[129]i[178]1[164]2000:[130]:[151]sp,0:[139]th(pl)[178]14[167]410
  55. 206 [139]np[178]2[167]200
  56. 208 [143] computer attack
  57. 210 pl[178]3[171]pl:m[178]2
  58. 212 [153]cl$"defscanning phasers
  59. 214 ifsh(pl,2)=1thenifth(3-pl)>int(rnd(1)*2+4)thenx=sx:y=sy:ts=2:goto220
  60. 216 fori=3to5:ifsh(pl,i)=0orsh(pl,i)=ithennext:goto248
  61. 218 ts=i:x=xh(ts):y=yh(ts):ifsh(pl,ts)>1then236
  62. 220 fori=0to3:pr(i)=0:next:gosub264
  63. 222 rd=int(rnd(1)*4):ifpr(rd)=1then222
  64. 224 xd(ts)=0:yd(ts)=0:pr(rd)=1
  65. 226 ifrd=0thenxd(ts)=+1:iftx<tsorxp=1then222
  66. 228 ifrd=1thenxd(ts)=-1:iftx<tsorxm=1then222
  67. 230 ifrd=2thenyd(ts)=+1:ifty<tsoryp=1then222
  68. 232 ifrd=3thenyd(ts)=-1:ifty<tsorym=1then222
  69. 234 x=x+xd(ts):y=y+yd(ts):goto256
  70. 236 tx=x+xd(ts):ty=y+yd(ts)
  71. 238 iftx<0ortx>9orty<0orty>9then244
  72. 240 ifgc(pl,tx,ty)=1then244
  73. 242 x=tx:y=ty:goto256
  74. 244 tx=sh(pl,ts)*-xd(ts):ty=sh(pl,ts)*-yd(ts):xd(ts)=-xd(ts):yd(ts)=-yd(ts)
  75. 246 x=x+tx:y=y+ty:goto256
  76. 248 x=int(rnd(1)*10):y=int(rnd(1)*10)
  77. 250 ifgc(pl,x,y)=1or(x=sxandy=sy)then248
  78. 252 gosub264:fori=2to5:ifsh(pl,i)thennext
  79. 254 iftx<iandty<ithen248
  80. 256 gosub380
  81. 258 gosub280:fori=1to2000:next:ifth(pl)=14then412
  82. 260 goto200
  83. 262 rem check x/y direction
  84. 264 xp=1:xm=1
  85. 266 ifx+xp<=9thenifgc(pl,x+xp,y)<>1thenxp=xp+1:goto266
  86. 268 ifx-xm=>0thenifgc(pl,x-xm,y)<>1thenxm=xm+1:goto268
  87. 270 tx=xp+xm-1:yp=1:ym=1
  88. 272 ify+yp<=9thenifgc(pl,x,y+yp)<>1thenyp=yp+1:goto272
  89. 274 ify-ym=>0thenifgc(pl,x,y-ym)<>1thenym=ym+1:goto274
  90. 276 ty=yp+ym-1:return
  91. 278 rem check for hit
  92. 280 fori=1to999:next:printcl$;:poke646,18-pl*4
  93. 282 k=gc(pl,x,y):gc(pl,x,y)=1
  94. 284 ifk=0thenprint"missed "+pl$(pl)+"target":return
  95. 286 ifk=1ork=9thenprint"previous "+pl$(pl)+"target":return
  96. 288 print"direct hit on "+pl$(pl)+ss$(pl,k)
  97. 290 m=3:gosub398
  98. 292 sh(pl,k)=sh(pl,k)+1:th(pl)=th(pl)+1
  99. 294 ifpl=1thenifsh(pl,k)<>kthenxh(k)=x:yh(k)=y:ifk=2thensx=x:sy=y
  100. 296 printleft$(d$,20+5-k)tab(cc(pl,6)+sh(pl,k))"*":ifsh(pl,k)<>kthen316
  101. 298 m=4:gosub398:poke646,7
  102. 300 printcl$:fori=1to5
  103. 302 print"[145]"pl$(pl)ss$(pl,k)"          ":forj=1to300:next
  104. 304 print"[145]"pl$(pl)ss$(pl,k)" destroyed":forj=1to500:next:next
  105. 306 ifk>2then316
  106. 308 t=3-pl:poke646,18-t*4
  107. 310 fori=0to9:printleft$(d$,9+i)tab(cc(t,0))"[193][194][195][193][194][195][193][194][195][193][194][195][193][194][195]":forj=0to9
  108. 312 ifgc(t,i,j)=1thengc(t,i,j)=9
  109. 314 next:next
  110. 316 return
  111. 318 rem position curser
  112. 320 poke198,0:x=xc(pl)/12:y=yc(pl)/8
  113. 322 pokevc,xc(pl)+sp(pl):pokevc+1,yc(pl)+114:pokevc+16,-(sp(pl)<0):pokesp,1
  114. 324 geta$:j$=mid$(str$(peek(56320)and31),2):forj=1to9step2
  115. 326 ifmid$("* ^ \ = "+chr$(13),j,1)=a$ormid$("2723302915",j,2)=j$then330
  116. 328 next:goto324
  117. 330 onj/2+.5goto332,334,336,338,346
  118. 332 x=x-1*-(x>0):goto340
  119. 334 x=x+1*-(x<9):goto340
  120. 336 y=y-1*-(y>0):goto340
  121. 338 y=y+1*-(y<9)
  122. 340 ifpl=2thenxx=-(x>4):sp(2)=200-xx*256:pokevc+16,xx
  123. 342 xc(pl)=x*12:yc(pl)=y*8
  124. 344 pokevc,xc(pl)+sp(pl):pokevc+1,yc(pl)+114:goto324
  125. 346 ifm=1andgc(pl,x,y)then324
  126. 348 onmgoto352,380
  127. 350 rem position ship
  128. 352 poke646,18-pl*4:printcl$"which direction? horiz or vert
  129. 354 [161]a$:j$[178][202]([196]([194](56320)[175]31),2):[129]j[178]1[164]3[169]2
  130. 356 [139][202]("^ = ",j,1)[178]a$[176][202]("2329",j,2)[178]j$[167]360
  131. 358 [130]:[137]354
  132. 360 [145]j[173]2[170].5[137]362,370
  133. 362 [129]j[178]0[164]k[171]1:[139]x[170]k[177]10[176]gc(pl,x[170]j,y)[167]i[178]i[171]1:k[178]k[170]1:[142]
  134. 364 [130]:t[178]x
  135. 366 [129]j[178]0[164]k[171]1:[145](pl[178]1[176]np[178]2)[170]2[141]380,384:gc(pl,x,y)[178]k:x[178]x[170]1
  136. 368 [130]:x[178]t:[142]
  137. 370 [129]j[178]0[164]k[171]1:[139]y[170]k[177]10[176]gc(pl,x,y[170]j)[167]i[178]i[171]1:k[178]k[170]1:[142]
  138. 372 [130]:t[178]y
  139. 374 [129]j[178]0[164]k[171]1:[145](pl[178]1[176]np[178]2)[170]2[141]380,384:gc(pl,x,y)[178]k:y[178]y[170]1
  140. 376 [130]:y[178]t:[142]
  141. 378 [143] display grid marker
  142. 380 [139](x[175]1)[178]0[167][153][200](d$,y[170]9)[163]cc(pl,x))"str$":[137]384
  143. 382 [153][200](d$,y[170]9)[163]cc(pl,x))"val"
  144. 384 [145]m[141]388,392:[142]
  145. 386 [143] sounds
  146. 388 [151]sr,240:[151]wv,17:[151]hf,50:[151]lf,35
  147. 390 [129]l[178]1[164]15:[130]:[151]wv,16:[142]
  148. 392 [151]sr,240:[129]i[178]0[164]30:[151]lf[170]24,15[171]i[173]2
  149. 394 [151]